home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Visual Basic Source Code
/
Visual Basic Source Code.iso
/
vbsource
/
library
/
form1.frm
< prev
next >
Wrap
Text File
|
1995-11-09
|
14KB
|
403 lines
VERSION 2.00
Begin Form Form1
Caption = "VB Library Routines"
ClientHeight = 5475
ClientLeft = 1455
ClientTop = 2250
ClientWidth = 6015
Height = 6165
Left = 1395
LinkTopic = "Form1"
ScaleHeight = 5475
ScaleWidth = 6015
Top = 1620
Width = 6135
Begin CommandButton Command1
Caption = "click to change to lower case"
Height = 375
Left = 2940
TabIndex = 4
Top = 4980
Width = 3015
End
Begin ListBox List1
Height = 1200
Left = 2940
TabIndex = 3
Top = 3720
Width = 3015
End
Begin TextBox Text2
Height = 1575
Left = 3480
MultiLine = -1 'True
ScrollBars = 2 'Vertical
TabIndex = 2
Text = "This is a sample text box that contains more than one line of text to be used in the Edit Menu and Highlight samples provided."
Top = 2100
Width = 2475
End
Begin TextBox Text1
Height = 1575
Left = 3480
MultiLine = -1 'True
ScrollBars = 2 'Vertical
TabIndex = 1
Text = "This is a sample text box that contains more than one line of text to be used in the Make Text Box Read-only sample provided."
Top = 480
Width = 2475
End
Begin Label Label1
Caption = "Label1"
Height = 255
Left = 3480
TabIndex = 0
Top = 120
Width = 2415
End
Begin Menu mnuFileMenu
Caption = "&File"
Begin Menu mnuFile
Caption = "&About"
Index = 0
End
Begin Menu mnuFile
Caption = "E&xit"
Index = 1
End
End
Begin Menu mnuEditMenu
Caption = "&Edit"
Begin Menu mnuEdit
Caption = "Undo"
Index = 0
End
Begin Menu mnuEdit
Caption = "Cu&t"
Index = 1
End
Begin Menu mnuEdit
Caption = "&Copy"
Index = 2
End
Begin Menu mnuEdit
Caption = "&Paste"
Index = 3
End
End
Begin Menu mnuSamplesMenu
Caption = "Samples (&A-L)"
Begin Menu mnuSamples
Caption = "Always on top"
Index = 0
End
Begin Menu mnuSamples
Caption = "Another Instance (detecting)"
Index = 1
End
Begin Menu mnuSamples
Caption = "Center Form"
Index = 2
End
Begin Menu mnuSamples
Caption = "Create Path"
Index = 3
End
Begin Menu mnuSamples
Caption = "Create Program Manager Group"
Index = 4
End
Begin Menu mnuSamples
Caption = "Create Program Manager Item"
Index = 5
End
Begin Menu mnuSamples
Caption = "Floating Window"
Index = 6
End
Begin Menu mnuSamples
Caption = "FreeDrive"
Index = 7
End
Begin Menu mnuSamples
Caption = "Get Windows Version"
Index = 8
End
Begin Menu mnuSamples
Caption = "Get Windows\System Directory"
Index = 9
End
Begin Menu mnuSamples
Caption = "Get Windows Directory"
Index = 10
End
Begin Menu mnuSamples
Caption = "Help Click"
Index = 11
End
Begin Menu mnuSamples
Caption = "Hide MDI Child Form"
Index = 12
End
Begin Menu mnuSamples
Caption = "Highlight Textbox Text"
Index = 13
End
Begin Menu mnuSamples
Caption = "If File Exists"
Index = 14
End
Begin Menu mnuSamples
Caption = "Is Path Valid"
Index = 15
End
Begin Menu mnuSamples
Caption = "Locate Pointer"
Index = 16
End
End
Begin Menu mnuSamples2Menu
Caption = "Samples (&M-Z)"
Begin Menu mnuSamples2
Caption = "Make Read-Only (textbox)"
Index = 0
End
Begin Menu mnuSamples2
Caption = "Menu (Edit) Shortcuts"
Index = 1
End
Begin Menu mnuSamples2
Caption = "Move Form without a titlebar"
Index = 2
End
Begin Menu mnuSamples2
Caption = "Paint Form (multi-colored) (no API)"
Index = 3
End
Begin Menu mnuSamples2
Caption = "Purge Numeric Input"
Index = 4
End
Begin Menu mnuSamples2
Caption = "Purge String (removing characters)"
Index = 5
End
Begin Menu mnuSamples2
Caption = "Read File Chunk"
Index = 6
End
Begin Menu mnuSamples2
Caption = "Reboot Computer"
Index = 7
End
Begin Menu mnuSamples2
Caption = "Resource Monitor"
Index = 8
End
Begin Menu mnuSamples2
Caption = "Restart Windows"
Index = 9
End
Begin Menu mnuSamples2
Caption = "Select Item in a listbox"
Index = 10
End
Begin Menu mnuSamples2
Caption = "UpEach make 1st letter of each word Cap"
Index = 11
End
Begin Menu mnuSamples2
Caption = "UpFirst -Capitalize 1st letter in string"
Index = 12
End
End
Begin Menu mnuHelpMenu
Caption = "&Help"
Begin Menu mnuHelp
Caption = "Contents"
Index = 0
End
Begin Menu mnuHelp
Caption = "Search"
Index = 1
End
Begin Menu mnuHelp
Caption = "Help on Help"
Index = 2
End
End
End
Option Explicit
Sub Command1_Click ()
Command1.Caption = LCase(Command1.Caption)
End Sub
Sub Form_Load ()
Dim x As Integer
Show
form2.Show
For x = 1 To 26
list1.AddItem String$(10, x + 64)
Next x
End Sub
Sub Form_MouseDown (Button As Integer, Shift As Integer, x As Single, Y As Single)
' Move Forms Without Title Bars
' This example was posted on the internet and shows a way that a form without a title bar can be moved around by the user with a mouse.
If Button = 1 Then ' Checking for Left Button only
Dim ReturnVal%
ReleaseCapture
ReturnVal% = SendMessage(hWnd, WM_NCLBUTTONDOWN, HTCAPTION, 0)
End If
End Sub
Sub mnuEdit_Click (Index As Integer)
' This routine is designed for a quick & dirty method for handling
' common edit menu functions.
Select Case Index
Case 0: SendKeys "%{BACKSPACE}" ' Undo
Case 1: SendKeys "+{DELETE}" ' Cut
Case 2: SendKeys "^{INSERT}" ' Copy
Case 3: SendKeys "+{INSERT}" '